#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(){

    srand(time(NULL));
    int rand_num,input_num;
    char s[][10]= {"石头","布","剪刀"};

    while(1){
        printf("请选择 1.石头,2.布3.剪刀\n");
        scanf("%d",&input_num);
        printf("你的选择:%s\n",s[input_num-1]);
        rand_num = rand()%3+1;
        printf("电脑的选择:%s\n",s[rand_num-1]);
        if(input_num==rand_num){
            printf("----平局-----\n");
            continue;
        }
        if(input_num<rand_num){
            if(rand_num-input_num==1){
                printf("---你输了---\n");
                continue;
            }
            if(rand_num-input_num==2){
                printf("---你赢了---\n");
                continue;
            }
        }
        if(input_num>rand_num)
        {
            if(rand_num-input_num==-1){
                 printf("---你赢了---\n");
                continue;
            }
            if(rand_num-input_num==-2){
                printf("---你输了---\n");
                continue;
            }
        }

}
}
